1. Field of the Invention
Embodiments of the present invention relate generally to computer graphics, and more specifically to a system and method for occlusion testing.
2. Description of the Related Art
In computer graphics, oftentimes portions of a first geometry in an image block from view portions of a second geometry in the image. In such situations, one or more primitives making up the first geometry are said to “occlude” one or more primitives making up the second geometry. For example, when rendering a car, the primitives comprising the body and hood may occlude the primitives of the interior and the engine.
As is well-known, occlusion testing is used to increase rendering performance by determining which primitives in an image are occluded by other primitives in the image. Once this information is known, only non-occluded primitives are rendered since these are the only primitives in view. Not rendering the occluded primitives reduces rendering time, thereby increasing rendering performance. Returning to the car example, by determining which primitives making up the interior and the engine are occluded and then not rendering those primitives, overall render time is reduced since time is not spent rendering parts of the car that are hidden from view.
In order to increase rendering performance, some graphics applications use the occlusion testing functionality that is directly available in graphics application program interfaces (APIs), such as the Open Graphics Library (OpenGL®). Sometimes, however, graphics applications fail to implement the occlusion testing functionality available in the APIs, leaving the graphics application with no occlusion testing functionality. In such cases, overall render performance may not be optimized.
As the foregoing illustrates, what is needed in the art is a means to enable occlusion testing functionality for applications that do not use available occlusion testing functionality.